<template>
  <div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { type Person, type Person2, type PersonList } from "@/types/04interface&type"

// 接口
let person:Person = { name: 'xiaoming', age: 18 }
let personList2:Person[] = [
  { name: 'xiaoming', age: 18 },
  { name: 'xiaohong', age: 20 }
]

// 泛型
let personList:Array<Person | Person2> = [
  { name: 'xiaoming', age: 18 },
  { name: 'xiaohong', age: 20 },
  { name: '鸡蛋' }
]

// 自定义类型
let personList3 = ref<PersonList>([ { name: 'xiaoming', age: 18 } ])
</script>

<style lang="scss" scoped>

</style>